﻿@using GlobalResources
@using Newtonsoft.Json;
@using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Web.Helpers
@model Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Web.Models.ActionPropertiesModel

@{
    ViewBag.Title = "Actions";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<noscript>
    <div class="error_noscript">
        <h1 class="error_noscript__header">@Strings.NoscriptHeader</h1>
        <p>@Strings.NoscriptP1</p>
        <p>@Strings.NoscriptP2</p>
    </div>
</noscript>


<div class="content_outer content_outer--background_color content_grid">
    <div class="content_inner content_inner--inherit_max_width_no_margin">
        <div class="grid_container height_fixed">

            @*Datatables plugin for jQuery. www.datatables.net*@
            <table id="actionTable" class="order-column">

                <thead>
                    <tr>
                        <th>@Strings.RuleOutputHeader</th>
                        <th>@Strings.ActionIDHeader</th>
                        <th>@Strings.NumberOfDevicesHeader</th>
                    </tr>
                </thead>

                <tbody></tbody>

            </table>
        </div>

        <div class="details_grid_closed height_fixed button_details_grid">
            <h2 class="details_grid_closed__grid_subhead">@Strings.PropertiesPaneLabel</h2>
        </div>

        <div class="details_grid height_fixed">

            <h2 class="details_grid__grid_subhead button_details_grid">@Strings.PropertiesPaneLabel</h2>
            <div id="details_grid_container">
                <div class="details_grid__no_selection">
                    @Strings.NoActionSelectedLabel
                </div>
            </div>

            <div id="loadingElement" class="loader_container loader_container_details">
                <div class="loader_container__loader"></div>
            </div>

        </div>

    </div>

</div>

<script>
    "use strict";

    var resources = {
        retry: '@Html.JavaScriptString(Strings.Retry)',
        serviceUnavailable: '@Html.JavaScriptString(Strings.ServiceUnavailable)',
        unableToRetrieveActionFromService: '@Html.JavaScriptString(Strings.UnableToRetrieveActionFromService)',
        disabled: '@Html.JavaScriptString(Strings.Disabled)',
        enabled: '@Html.JavaScriptString(Strings.Enabled)',
        failedToRetrieveActions: '@Html.JavaScriptString(Strings.FailedToRetrieveActions)',
        noActionSelected: '@Html.JavaScriptString(Strings.NoActionSelectedLabel)',
        failedToUpdateActionId: '@Html.JavaScriptString(Strings.FailedToUpdateActionId)',
        readonlyActions: '@Model.HasAssignActionPerm.ToString().ToLower()',
        actionsList: '@Html.JavaScriptString(Strings.Actions)'
    };
</script>

<script src="~/Scripts/jquery-datatables-api-extensions.js"></script>
<script src="~/Scripts/Views/Actions/ActionsIndex.js?ver=@Constants.JSVersion"></script>
<script src="~/Scripts/Views/Actions/ActionProperties.js?ver=@Constants.JSVersion"></script>